package com.tubi.MyArrays;

import java.util.Arrays;

public class testToString {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        System.out.println(Arrays.toString(arr)); //转字符串


        int[] arr1 = {2,3,8,9,12,32,23};
        Arrays.sort(arr1); //排序
        System.out.println(Arrays.toString(arr1));

        int[] arr2 = {3,4,1,2,98,54,55};
        //数组必须有序
        //如果查找存在，返回数组元素的索引
        //如果不存在返回（-插入点-1）
        Arrays.sort(arr2);//进行排序
        int a = Arrays.binarySearch(arr2, 55);//查找指定位置索引
        System.out.println(a);

    }
}
